<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript">
	var reformId = null;
	function openAddReform(){
		var validateReform = "${ctx}/renovation_renovateViolationAction.do?method=validateReform&renovateViolationId=${renovateViolationId}";
		new Ajax.Request(validateReform,
	         { method:'post',
			   parameters:{},
			   onComplete:function(response){
				if(response.responseText == 'pass'){
					ErrorAlert("该违规记录已经整改验收通过，不得再做完工验收！");
				}else if(response.responseText == 'unhandled'){
					ErrorAlert("该违规记录未做违规处理，不得进行完工验收！");
				}else if(response.responseText == 'finished'){
					ErrorAlert("该违规记录已经完工验收，不得进行完工验收！");
				}else{
					var url = "${ctx}/renovation_renovateViolationAction.do?method=initReformAdd&id=${renovateViolationId}";
					top.windowOpen(url, 'reformAdd', '完工验收',420, 800,  true, "reformAdd");
			   }
			 }});
	}
	function showDelete(){
		if( reformId == null ){
			ErrorAlert('${key.tipsByDelete}');
		}else{
			var validateDeleteReform = "${ctx}/renovation_renovateViolationAction.do?method=validateDeleteReform&reformId="+reformId;
			new Ajax.Request(validateDeleteReform,
		         { method:'post',
				   parameters:{},
				   onComplete:function(response){
					if(response.responseText == 'false'){
						ErrorAlert("必须删除已完工的完工验收记录，才允许删除其它未完工的记录");
					}else{
						AlarmConfirm('${key.tipsByDeleteConfirm}',"reformList","deleteRecord");
				   }
				 }});
		}
	}

	function setSelectReformId(id){
		reformId = id;
	}
	function reloadReform(){
		reformId = null;
		$('reformList').src="${ctx}/renovation_renovateViolationAction.do?method=initReformList&renovateViolationId=${renovateViolationId}";
	}

	function closewin(){
		findFrame('main').reloadRenovate();
		windowClose();
	}
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="window_head_outBg">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td><span class="window_head_intext"><img
					src="${ctx}/images/ico_Advance.gif" align="absmiddle" />&nbsp;完工验收记录</span></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="aux_header_line_1"></td>
	</tr>
	<tr>
		<td class="aux_header_line_2"></td>
	</tr>
	<tr>
		<td valign="middle" class="content">
		<table width="100%" border="0" cellpadding="0" cellspacing="1">
			<tr>
				<td>
				<div>
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					class="tab_line">
					<tr>
						<td class="bg_toolBar">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="35%">&nbsp;</td>
								<td width="65%" align="right"><!--------------------------右边图标01----------------------------------->
								<table border="0" cellpadding="0" cellspacing="0" id="ico1">
									<tr>
										<td class="toolbarico"><a href="#"
											onClick="openAddReform()" onFocus="this.blur()"><img
											src="${ctx}/images/ico_newfile.gif" alt="新增完工验收" width="16"
											height="16" border="0" align="absbottom" />&nbsp;</a></td>
										<td class="toolbarico"><a href="#" onClick="showDelete()"
											onFocus="this.blur()"><img
											src="${ctx}/images/ico_delete.gif" alt="删除" width="16"
											height="16" border="0" align="absbottom" /></a></td>
										<td class="toolbarico">&nbsp;</td>
									</tr>
								</table>
								</td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td valign="top"><iframe
							src="${ctx}/renovation_renovateViolationAction.do?method=initReformList&renovateViolationId=${renovateViolationId}"
							name="reformList" id="reformList" width="100%" height="200px"
							frameborder="0" scrolling="auto"> </iframe></td>
					</tr>
				</table>
				</div>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td colspan="2" class="window_footer">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="btn_between_space"></td>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="buttonOffLeft" id="btn1_31"></td>
						<td class="buttonOffMiddle" id="btn1_32"
							onClick="javascript:closewin();" onMouseOver="btn_change_over(3)"
							onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img
							src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14"
							border="0" align="absbottom" /> 关 闭</td>
						<td class="buttonOffRight" id="btn1_33"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		<p>&nbsp;</p>
		</td>
	</tr>
</table>
</body>
</html>